<template>
  <div class="loadding">
    <van-loading
      type="spinner"
      color="#1989fa"
      size="30px"
      vertical
      text-size="16px"
      text-color="#0094ff"
    >
      小撩疯狂加载中
    </van-loading>
  </div>
</template>

<script>
  export default{
    props:['isLoad','num'],
    data() {
      return {
        show: true
      }
    },

    created() {
      this.$store.commit('initLoadCount',this.num)
      const timer = setInterval(() => {
        if(this.$store.state.loadCount <= 0){
          clearInterval(timer)
          setTimeout(() => {
            // this.isLoad = false
            this.$emit('update:isLoad', false)
          },2000)
        }
      })
    },
  }
</script>

<style>
  .loadding{
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
  }
</style>
